﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DIST.LR.ZHJG.Controls.Chart
{
    public partial class ucPie4 : UserControl
    {
        public ucPie4()
        {
            InitializeComponent();
            this.chart.Loaded += new RoutedEventHandler(chart_Loaded);
        }

        void chart_Loaded(object sender, RoutedEventArgs e)
        {
            var c = sender as Visifire.Charts.Chart;
            IEnumerable<TextBlock> lablels = VisualTreeAPI.FindVisualChildren<TextBlock>(c.Parent as System.Windows.Controls.Grid);
            foreach (TextBlock txt in lablels)
            {
                if (txt.Text.ToLower().Contains("trial"))
                {
                    txt.Visibility = System.Windows.Visibility.Collapsed;
                    if (txt.Parent is Border)
                    {
                        (txt.Parent as Border).Background = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
                    }
                    //txt.Parent
                }
            }
        }
    }
}
